import PropTypes from '../_utils/props-types'
import { tuple } from '../_utils/props-tools'

export const searchProps = () => ({
    prefixCls: PropTypes.string,
    width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
    height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
    radius: PropTypes.number.def(48),
    value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
    placeholder: PropTypes.string,
    suffix: PropTypes.any,
    gap: PropTypes.number.def(0),
    borderColor: PropTypes.string,
    textColor: PropTypes.string,
    backgroundColor: PropTypes.string,
    boxShadow: PropTypes.bool.def(false),
    boxShadowColor: PropTypes.string.def('#000'),
    boxShadowBlur: PropTypes.number.def(6),
    searchAction: PropTypes.string,
    searchMethod: PropTypes.string.def('post'),
    searchParams: PropTypes.object.def({}),
    searchKey: PropTypes.string.isRequired,
    searchKeyColor: PropTypes.string,
    searchDelay: PropTypes.number,
    data: PropTypes.array,
    listShowAnimation: PropTypes.oneOf(
        tuple(
            'fade',
            'scale',
            'slide',
            'slide-right',
            'slide-bottom',
            'slide-fall',
            'newspaper',
            'sticky',
            'flip',
            'flip-horizontal',
            'flip-vertical',
            'fall',
            'rotate',
            'sign'
        )
    ).def('scale'),
    itemTemplate: PropTypes.any,
    itemColor: PropTypes.string,
    itemBorderBottomColor: PropTypes.string,
    itemContentColor: PropTypes.string,
    listWidth: PropTypes.number,
    listHeight: PropTypes.number,
    listRadius: PropTypes.number.def(24),
    listBorderColor: PropTypes.string,
    listBackground: PropTypes.string,
    listBoxShadow: PropTypes.bool.def(true),
    listBoxShadowColor: PropTypes.string,
    listBoxShadowBlur: PropTypes.number.def(6),
    listNoDataText: PropTypes.string,
    listNoDataColor: PropTypes.string.def('#000'),
    listDestroyOnHide: PropTypes.bool.def(false),
    pagination: PropTypes.bool.def(true),
    pageSize: PropTypes.number.def(10),
    pageColor: PropTypes.string,
    pageBorderTopColor: PropTypes.string,
    colseAfterItemClick: PropTypes.bool.def(false)
})
